package com.xplusplus.security.repository;

import com.xplusplus.security.domain.Permission;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

/**
 * @Author: zhouweixin
 * @Description: 权限Repository
 * @Date: Created in 12:32 2018/5/22
 * @Modified By:
 */
@Repository
public interface PermissionRepository extends JpaRepository<Permission, Integer> {
    /**
     * 通过名称模糊查询-分页
     */
    Page<Permission> findByNameLike(String name, Pageable pageable);

    void deleteByIdIn(Collection<Integer> ids);

    List<Permission> findByIdIn(Collection<Integer> ids);
}
